package com.irdstudio.apicenter.core.code.generator.veloctity.html;

import java.util.ArrayList;
import java.util.List;

import com.irdstudio.apicenter.core.code.generator.ICodeGenerator;
import com.irdstudio.apicenter.core.code.generator.veloctity.VelocityTempletData;
import com.irdstudio.apicenter.frame.maker.dm.SPageParamMain;
import com.irdstudio.apicenter.frame.maker.dm.SPageParamTag;

public class Test {

	public static void main(String[] args) throws Exception {

		ICodeGenerator generator = new HTMLCodeGenerator();

		VelocityTempletData data = new VelocityTempletData();

		data
				.setTempletFile("com/yuchengtech/core/code/generator/veloctity/html/login.html.vm");
		data.setTfileName("login.html");
		data
				.settFilePach("/Users/ZhangHao/Documents/workspace/macms/src/main/java/com/yuchengtech/core/code/generator/veloctity/html/");
		// data.setTempletFile(templetFile);

		List<SPageParamMain> list = new ArrayList<SPageParamMain>();

		SPageParamMain main = new SPageParamMain();
		main.setTemplateParamType("01");
		main.setTemplateParamCode("pageId");
		main.setParamValue("login");

		SPageParamMain main2 = new SPageParamMain();
		main2.setTemplateParamType("02");
		main2.setTemplateParamCode("login_form");

		List<SPageParamTag> list2 = new ArrayList<SPageParamTag>();

		SPageParamTag tag1 = new SPageParamTag();
		tag1.setTagType("text_001");
		tag1
				.setTagValueSrc("lable=用户名,id=user_id,name=user_name,placeholder=请输入用户名");

		SPageParamTag tag2 = new SPageParamTag();
		tag2.setTagType("password_001");
		tag2
				.setTagValueSrc("lable=密码,id=password_id,name=password_name,placeholder=请输入用密码");

		list2.add(tag1);
		list2.add(tag2);

		main2.setsPageParamTags(list2);
		list.add(main2);
		list.add(main);

		data.setTempletData(list);

		generator.generator(data);
	}
}
